package com.tx.dishes.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tx.dishes.dao.DishesDao;
import com.tx.dishes.pojo.Dishes;
import com.tx.dishes.service.DishesService;

@Service
public class DishesServiceImpl implements DishesService{

	@Autowired
	private DishesDao dishesDao;

	public List<Dishes> selectAll() {
		List<Dishes> list = dishesDao.selectAll();
		return list;
	}

	public boolean deleteDishesByDid(Dishes dishes) {
		int n = dishesDao.deleteDishesByDid(dishes);
		return n > 0;
	}

	public boolean addDishes(Dishes dishes) {
		int n = dishesDao.addDishes(dishes);
		return n > 0;
	}

	public Dishes selectDishesByDid(Dishes dishes) {
		Dishes d = dishesDao.selectDishesByDid(dishes);
		return d;
	}

	public boolean updateDishes(Dishes dishes) {
		int n = dishesDao.updateDishes(dishes);
		return n > 0;
	}
	
}
